home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Other / upsd / ups_folder / README < prev    next >
Encoding:
Text File  |  1991-05-01  |  4.5 KB  |  133 lines

  1.     upsd release 03/30/91 version 1.0 patchlevel 3            Pg. 1
  2.  
  3.  
  4.     INTRODUCTION
  5.  
  6.     The UPS monitor daemon or "upsd"  watches the serial port
  7.     connected to an UPS and will perform an unattended shutdown
  8.     of the system if the UPS is on battery longer than a specified
  9.     number of minutes.  Upsd needs to watch a tty with modem control
  10.     properties, and expects the UPS to raise DCD when it switches
  11.     to battery backup and drop DCD when it goes back to online.
  12.     Upsd was developed and tested under ISC with the FAS 2.08 driver
  13.     and an American Power Conversion SmartUPS 600, your milage may
  14.     vary on other OSes and UPSes.
  15.  
  16.     The C source was written for system V and hence will require 
  17.     some work to get it working under BSD or other UNIXes, the
  18.     program is built via the Makefile.  A number of configurable
  19.     defaults are in common.h, you may want to hack that file before
  20.     making upsd.  Although the program can be run manually from the
  21.     command line, users will most likely want the program to start
  22.     automatically from their /etc/rc script (SYS5R2) or a script
  23.     in /etc/rc2.d (SYS5R3).  The Makefile by default installs upsd
  24.     in the /etc directory when the install target is made.  
  25.  
  26.  
  27.     upsd release 03/30/91 version 1.0 patchlevel 3            Pg. 2
  28.  
  29.  
  30.     COMMAND LINE OPTIONS
  31.  
  32.     Upsd runtime behavior can be configured either on the command
  33.     line or via environment variables.  The command line options
  34.     take precedence to the environment variable settings, and are
  35.     as follows:
  36.  
  37.     usage: upsd [-d tty][-c cmd][-l file][-t min][-f file][-r file]
  38.         -d tty        pathname of UPS device
  39.         -c cmd        pathname of shutdown command
  40.         -l file        pathname of UPS log file
  41.         -f file        pathname of UPS fail message file
  42.         -r file        pathname of UPS restore message file
  43.         -t min        delay time in minutes
  44.  
  45.     The -d tty option must specify the full pathname (including the
  46.     /dev/ prefix) to the tty device the UPS is on.
  47.  
  48.     Example:
  49.  
  50.     upsd -d /dev/ttyFM00
  51.  
  52.     The -c cmd option specifies the full pathname of the command
  53.     to be executed to shut down the system.  This command must
  54.     be enclosed in quotes if it consists of 2 or more words.
  55.  
  56.     Example:
  57.  
  58.     upsd -c "/etc/shutdown -y -i0"
  59.  
  60.     The -l option specifies the logfile upsd will write it's event
  61.     messages to, these messages give the date and time that the UPS
  62.     daemon started, switched to battery, switched back to online,
  63.     executed the shutdown command, or was terminated via SIGTERM.
  64.  
  65.     Example:
  66.  
  67.     upsd -l /etc/upslog
  68.  
  69.     The -f option specifies the path name of the failure message file
  70.     to broadcast to all users in the event of a power failure.  The
  71.     failure message file is simply an ASCII text file which you can
  72.     create with an editor such as vi(1). If the file is not found by
  73.     upsd, no message will be broadcast upon power failure.
  74.  
  75.     Example:
  76.  
  77.     upsd -f /etc/upsfail
  78.  
  79.     The -r option specifies the path name of the restore message file
  80.     to broadcast to all users in the event of power restore.  The
  81.     restore message file is simply an ASCII text file which you can
  82.     create with an editor such as vi(1). If the file is not found by
  83.     upsd, no message will be broadcast upon power restore.
  84.  
  85.     Example:
  86.  
  87.     upsd -f /etc/upsrest
  88.  
  89.     Finally, the -t option specifies the number of minutes to allow
  90.     the UPS to be on battery backup before executing the shutdown
  91.     sequence.  This number must be between 1 and 30.  Be careful not
  92.     to choose a value greater than the number of minutes of battery
  93.     time your UPS supports with your current load.  A value in the
  94.     5 to 10 minute range is probably sufficient.
  95.  
  96.     Example:
  97.  
  98.     upsd -t 10
  99.     
  100.     upsd release 03/30/91 version 1.0 patchlevel 3            Pg. 3
  101.  
  102.  
  103.     ENVIRONMENT VARIABLES
  104.  
  105.     The following environment variables can be set if that interface
  106.     is preferred to the command line options.  Note again that command
  107.     line options override the environment variable settings.
  108.  
  109.  
  110.     Environment    Equivalent        Default
  111.     Variable    Command line option    Value
  112.     UPSPORT            -p        /dev/ttyFM00
  113.     UPSSHUT            -c        "/etc/shutdown -y -i0"
  114.     UPSLOG            -l        /etc/upslog
  115.     UPSFAIL            -f        /etc/upsfail
  116.     UPSREST            -r        /etc/upsrest
  117.     UPSTIME            -t        10
  118.  
  119.     Note that the compiled in default values can be altered in common.h
  120.     and the program can be recompiled.  If no command line options or
  121.     environment variables exist, the defaults will be used.  The table
  122.     above gives the environment variables looked for by the program and
  123.     their command line option counterparts.  All the rules applying to
  124.     the command line options apply to the environment variables as well.
  125.  
  126.     If you have any comments or suggestions regarding my program,
  127.     send email to the following address:
  128.  
  129.     Arthur W. Neilson III
  130.     INET: art@pilikia.pegasus.com
  131.     UUCP: uunet!ucsd!nosc!pilikia!art
  132.  
  133.